//
//  GoldsecendCell.swift
//  XiaoJingMallSwift
//
//  Created by beisheng03 on 2017/8/9.
//  Copyright © 2017年 beisheng. All rights reserved.
//

import UIKit

class GoldsecendCell: BaseTableViewCell {
    
    @IBOutlet weak var topLeftLabel: UILabel!
    
    @IBOutlet weak var bottomLeftLabel: UILabel!
    
    @IBOutlet weak var bgView2: UIView!
    @IBOutlet weak var bgView1: UIView!
    @IBOutlet weak var topMiddleLabel: UILabel!
    
    @IBOutlet weak var bottomMiddleLabel: UILabel!
    
    @IBOutlet weak var topRightLabel: UILabel!
    
    @IBOutlet weak var bottomRightLabel: UILabel!
    @IBOutlet weak var btn: UIButton!
    
    var model : GoldInfoModel?{
    
        didSet{
        
            if model == nil {
                return
            }
            
            topRightLabel.text = model!.total_gold + "个"
            
            bottomRightLabel.text = model!.freeze_gold + "个"
        
        }
    
    }
    

    override func awakeFromNib() {
        super.awakeFromNib()
        
        contentView.backgroundColor = UIColor.white

        btn.addCornerAndBorder(borderColor: UIColor.red, borderWidth: 0.6, masksToBounds: true, cornerRadius: 18)
        
        topLeftLabel.addCornerAndBorder(borderColor: nil, borderWidth: 0, masksToBounds: true, cornerRadius: 15)

        bottomLeftLabel.addCornerAndBorder(borderColor: nil, borderWidth: 0, masksToBounds: true, cornerRadius: 15)
        
        bgView1.addCornerAndBorder(borderColor: nil, borderWidth: 0, masksToBounds: true, cornerRadius: 5)

        bgView2.addCornerAndBorder(borderColor: nil, borderWidth: 0, masksToBounds: true, cornerRadius: 5)

        
        topMiddleLabel.textColor = UIColor.dakGray()
        
        topRightLabel.textColor = UIColor.dakGray()
        
        bottomMiddleLabel.textColor = UIColor.dakGray()
        
        bottomRightLabel.textColor = UIColor.dakGray()

    }

    @IBAction func btnDidTap(_ sender: UIButton) {
        
 viewController().navigationController?.pushViewController(GoodsListController(), animated: true)
        
    }
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
